.edit-case-container {
  max-width: 900px;
  margin: 0 auto;
  padding-bottom: 80px; /* 为底部固定按钮留出空间 */
}

.edit-case-box {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 30px;
}

.edit-case-box h2 {
  margin: 0 0 30px 0;
  color: #333;
  font-size: 24px;
  padding-bottom: 15px;
  border-bottom: 2px solid #667eea;
}

.form-section {
  margin-bottom: 30px;
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #333;
  font-weight: 500;
  font-size: 14px;
}

.form-group label.required::after {
  content: ' *';
  color: #ff4d4f;
}

.form-group input[type="text"],
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
  transition: all 0.3s;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
  resize: vertical;
  line-height: 1.6;
}

/* 字符计数 */
.char-count {
  text-align: right;
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

/* 图片展示网格（只读） */
.image-display-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 12px;
}

.image-item {
  position: relative;
  width: 100%;
  padding-top: 100%; /* 保持1:1的宽高比 */
  background: #f5f5f5;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  overflow: hidden;
  transition: all 0.3s;
}

.image-item.readonly {
  cursor: default;
}

.image-item:not(.readonly):hover {
  border-color: #667eea;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.image-item img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.remove-image-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  z-index: 1;
}

.remove-image-btn:hover {
  background: rgba(255, 77, 79, 0.9);
  transform: scale(1.1);
}

/* 添加图片按钮 */
.add-image-item {
  border-style: dashed;
  border-color: #d9d9d9;
  background: #fafafa;
}

.add-image-item:hover {
  border-color: #667eea;
  background: #f0f2ff;
}

.add-image-btn {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #999;
  transition: all 0.3s;
}

.add-image-item:hover .add-image-btn {
  color: #667eea;
}

.add-icon {
  font-size: 32px;
  font-weight: 300;
  line-height: 1;
  margin-bottom: 8px;
}

.add-text {
  font-size: 14px;
}

.no-images {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: #999;
  font-size: 14px;
  background: #fafafa;
  border: 1px dashed #d9d9d9;
  border-radius: 4px;
}

/* 重新上传按钮 */
.reupload-btn {
  padding: 8px 20px;
  background: white;
  color: #667eea;
  border: 1px solid #667eea;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 8px;
}

.reupload-btn:hover {
  background: #667eea;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.reupload-btn:active {
  transform: translateY(0);
}

.upload-tip {
  font-size: 12px;
  color: #999;
  margin-top: 8px;
}

/* 单选按钮组 */
.radio-group {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.radio-item {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: normal;
  margin-bottom: 0;
}

.radio-item input[type="radio"] {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  cursor: pointer;
  accent-color: #667eea;
}

.radio-item span {
  font-size: 14px;
  color: #333;
  user-select: none;
}

.radio-item:hover span {
  color: #667eea;
}

/* 加载和错误状态 */
.loading-container {
  text-align: center;
  padding: 60px 20px;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  margin: 0 auto 20px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-container p {
  color: #666;
  font-size: 16px;
}

.error-container {
  text-align: center;
  padding: 60px 20px;
}

.error-message {
  color: #ff4d4f;
  font-size: 16px;
  margin-bottom: 20px;
}

.retry-btn,
.back-btn {
  padding: 10px 30px;
  margin: 0 8px;
  border: none;
  border-radius: 5px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
}

.retry-btn {
  background: #667eea;
  color: white;
}

.retry-btn:hover {
  background: #5568d3;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.back-btn {
  background: white;
  color: #666;
  border: 1px solid #d9d9d9;
}

.back-btn:hover {
  color: #333;
  border-color: #999;
}

/* 底部固定按钮 */
.fixed-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid #e8e8e8;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

.footer-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px 30px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.cancel-btn,
.save-btn {
  padding: 10px 32px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
}

.cancel-btn {
  background: white;
  color: #666;
  border: 1px solid #d9d9d9;
}

.cancel-btn:hover {
  color: #333;
  border-color: #999;
}

.save-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.save-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.save-btn:active:not(:disabled) {
  transform: translateY(0);
}

.save-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .edit-case-container {
    padding: 0 16px;
    padding-bottom: 80px;
  }

  .edit-case-box {
    padding: 20px;
  }

  .image-display-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .image-item {
    padding-top: 100%;
  }

  .footer-content {
    padding: 12px 16px;
  }

  .radio-group {
    flex-direction: column;
    gap: 12px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .image-display-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

